home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / amos / amoslist-0295.lzh / AMOSLIST / text0276.txt < prev    next >
Encoding:
Text File  |  1995-03-01  |  851 b   |  27 lines

  1. >  I have one other small problem (more an annoyance, really) in that
  2. >I use Input #1 at the start of the game to load in the 
  3. >level data which takes the form of several arrays of dimensions 
  4. >(40,40) or so, and it takes absolutely *ages*. Is there
  5. >any quicker way of loading variables from disk?  I have tried
  6. >moving the files to ram: first but this makes no substantial
  7. >speed difference from the hard drive. I dread to think
  8. >what it would be like off floppies.
  9.  
  10.   Use Ssave, i.e.
  11.  
  12. Dim ARRAY(X,Y)
  13. ..
  14. Ssave 1,Varptr(ARRAY(0,0)) To Varptr(ARRAY(X,Y)+4)
  15.  
  16. and later:
  17.  
  18. Sload 1 To Varptr(ARRAY(0,0)),(X+1)*(Y+1)*4
  19.  
  20.   Alternatively, use Copy to copy the arrays to a memory bank, and
  21. then just Save the entire bank.
  22.  
  23.   --Andy Church (achurch@goober.mbhs.edu)
  24.     WWW: http://www.mbhs.edu/~achurch/
  25.     AMOS Web Site: http://www.mbhs.edu/~achurch/amos/
  26.  
  27.